package com.example.mybaiduweishi.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.mybaiduweishi.R;
import com.example.mybaiduweishi.activity.OneKeySOSActivity;
import com.example.mybaiduweishi.fragments.base.BaseFragmentbase;

import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class firstFragment extends BaseFragmentbase {


    Unbinder unbinder;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        unbinder = ButterKnife.bind(this, super.onCreateView(inflater, container, savedInstanceState));

        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public int getXML() {
        return R.layout.first_fragment;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {

    }



    @OnClick(R.id.btn_sos)
    public void onViewClicked() {
//        getFragmentManager().beginTransaction().hide(new firstFragment()).replace(R.id.fl_sos,new secondFragment()).commit();

        //获取主Activity   Activity怎么管理这几个Fragment
        //调用主Activity的toSecondFragment()  跳转第二个Fragment
        if (getActivity() instanceof OneKeySOSActivity){
            ((OneKeySOSActivity) getActivity()).toSecondFragment();
        }
    }
}
